using System;
using System.Collections.Generic;
using System.Text;

namespace NSimpleDB.Service.Contract
{
    [Serializable]
    public class SimpleDBException : ApplicationException
    {
        private int errorCode;

        public SimpleDBException() : base() { }
        public SimpleDBException(int errorCode) : base() { this.errorCode = errorCode; }

        public SimpleDBException(string message) : base(message) {}
        public SimpleDBException(int errorCode, string message) : base(message) { this.errorCode = errorCode; }

        public SimpleDBException(string message, params object[] args) : base(string.Format(message, args)) { }
        public SimpleDBException(int errorCode, string message, params object[] args) : base(string.Format(message, args)) { this.errorCode = errorCode; }

        public SimpleDBException(string message, Exception innerException) : base(message, innerException) { }
        public SimpleDBException(int errorCode, string message, Exception innerException) : base(message, innerException) { this.errorCode = errorCode; }

        public int ErrorCode
        {
            get { return this.errorCode; }
        }
    }
}
